#include <iostream>
#include <vector>
#include <stdlib.h>
typedef std::vector<int> vec;
typedef std::vector<bool> vecb;
std::vector<vecb> d;
vec org, c;
int main(){
	freopen("arena.in", "r", stdin);
	freopen("arena.out", "w", stdout);
	vec *old,*nw;
	vecb *ew;
	nw = new vec;
	int n, m, t, q = 0;
	std::cin >> n >> m;
	for(int i = 0;i < n; i++){
		std::cin >> t;
		org.push_back(t);
	}
	for(int i = 0;i < m; i++){
		std::cin >> t;
		c.push_back(t);
	}
	for(;;){
		t = getchar();
		if(t == '\n' && q == 0){
			ew = new vecb;
			continue;
		}
		if(t == '\n'){
			d.push_back(*ew);
			if(q == 1){
				break;
			}
			ew=new vecb;
			continue;
		}
		else{
			ew->push_back(t - '1');
			q++;
		}
	}
	int T;
	std::cin>>T;
	//....
	srand(1145);
	for(int i = 0;i < T; i++){
		std::cout << rand()%100 << '\n';
	}
	return 0;
}
